
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
	layout:decorator="main">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>教师显示</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script language="javascript">
	$(function() {
		//导航切换
		$(".imglist li").click(function() {
			$(".imglist li.selected").removeClass("selected")
			$(this).addClass("selected");
		})
	})
</script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#addTeacher").click(function() {
			window.location.href = "/addTeacherHTML";
		});
	});
</script>
</head>
<body>
	<div layout:fragment="content">
		<div class="place">
			<span>位置：</span>
			<ul class="placeul">
				<li><a href="/ordering/home">首页</a></li>
				<li><a href="#">教师信息</a></li>
			</ul>
		</div>

		<div class="rightinfo">
			<div class="tools">
				<ul class="toolbar">
					<li id="addTeacher"><span><img src="images/t01.png" /></span>添加</li>
				</ul>
			</div>
			<form action="getTeacher" method="post">
				<div class="container">
					<div class="row">
						<div class="col">
							<input type="text" name="school.name"
								th:value="${teacher.school} eq null ? '':${teacher.school.name}"
								placeholder="请输入学校" class="form-control" aria-label="Large"
								aria-describedby="inputGroup-sizing-sm" />
						</div>
						<div class="col">
							<input type="text" name="mobile" th:value="${teacher.mobile}"
								placeholder="请输入手机号" class="form-control" aria-label="Large"
								aria-describedby="inputGroup-sizing-sm" />
						</div>
						<div class="col">
							<input type="text" name="name" th:value="${teacher.name}"
								placeholder="请输入姓名" class="form-control" aria-label="Large"
								aria-describedby="inputGroup-sizing-sm" />
						</div>
						<div class="col">
							<select class="form-control" aria-label="Large"
								th:field="${teacher.subject.id}">
								<option value=""></option>
								<option value="1">语文</option>
								<option value="2">数学</option>
								<option value="3">英语</option>
								<option value="4">物理</option>
								<option value="5">化学</option>
								<option value="6">生物</option>
								<option value="7">政治</option>
								<option value="8">历史</option>
								<option value="9">地理</option>
								<option value="10">音乐</option>
								<option value="11">美术</option>
								<option value="12">体育</option>
							</select>
						</div>
						<div class="col">
							<button type="submit" class="btn btn-primary ">搜索</button>
						</div>
					</div>
				</div>
			</form>
			<br />
			<table class="table table-hover">
				<thead>
					<tr>
						<td>序号</td>
						<td>ID</td>
						<td>头像</td>
						<td>姓名</td>
						<td>手机号</td>
						<td>所在学校</td>
						<td>任教科目</td>
						<td>状态</td>
						<td>创建时间</td>
						<td>操作</td>
					</tr>
				</thead>

				<tbody th:object="${teacherPageBean}">
					<tr th:each="tea :*{list}">
						<td th:text="${teaStat.count}">序号</td>
						<td th:text="${tea.id}">ID</td>
						<td th:text="${tea.headImage}">头像</td>
						<td th:text="${tea.name}">姓名</td>
						<td th:text="${tea.mobile}">手机号</td>
						<td th:text="${tea.school eq null} ? '无':${tea.school.name}">所在学校</td>
						<td th:text="${tea.subject eq null} ? '无':${tea.subject.name}">任教科目</td>
						<td th:text="${tea.name}">状态</td>
						<td th:text="${tea.createTime}">创建时间</td>
						<td><a href="#"
							th:href="@{/updateTeacherHTML(teacherId=${tea.id})}">编辑</a> <a
							href="#"
							th:href="@{/deleteTeacher(teacherId=${tea.id},currentPage=${teacherPageBean.currentPage},school.name=${teacher.school} eq null ? '':${teacher.school.name},mobile=${teacher.mobile},name=${teacher.name},subject.id=${teacher.subject} eq null ? '':${teacher.subject.id})}">删除</a></td>
					</tr>
				</tbody>
			</table>
			<div th:include="page :: TeacherPager" th:remove="tag"></div>
		</div>
		<script type="text/javascript">
			$('.imgtable tbody tr:odd').addClass('odd');
		</script>
		<!-- 	<script type="text/javascript">
	$(document).ready(function() {
		var img  =  $("#imgId")[0].src; 
		var a  = img.substr(""");
		alert(a);
		/* $("#imgId").attr('src','data:image/png;base64,'+img); */ 
	});
</script> -->
	</div>
</body>
</html>
